const tokenKey = 'Token'

function getToken() {
  return localStorage.getItem(tokenKey) || sessionStorage.getItem(tokenKey);
}

function removeToken() {
  localStorage.removeItem(tokenKey);
  sessionStorage.removeItem(tokenKey);
}

function setToken(rememberMe,token) {
  if (rememberMe) {
    localStorage.setItem(tokenKey, token);
  } else {
    sessionStorage.setItem(tokenKey, token);
  }
}


const  loginUserKey = "LoginUser";

function setLoginUser(loginUser) {
  sessionStorage.setItem(loginUserKey, JSON.stringify(loginUser));
}

function getLoginUser() {
  return JSON.parse(sessionStorage.getItem(loginUserKey))
}